package com.gxsyh.nantie.statements.management.provider.service.impl;

import com.gxsyh.nantie.statements.management.provider.domain.UserOrderInfo;
import com.gxsyh.nantie.statements.management.provider.mapper.UserOrderInfoMapper;
import com.gxsyh.nantie.statements.management.provider.service.TbDepartmentService;
import com.gxsyh.nantie.statements.management.provider.service.UserOrderInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserOrderInfoServiceImpl implements UserOrderInfoService {

    @Resource
    private UserOrderInfoMapper userOrderInfoMapper;

    @Resource
    private TbDepartmentService tbDepartmentService;

    @Override
    public List<UserOrderInfo> selectUserOrderInfo(Long userId) {
        List<UserOrderInfo> userOrderInfoList=userOrderInfoMapper.selectUserOrderInfo(userId);
        for (UserOrderInfo list:userOrderInfoList)
        {
            list.setDepartmentUserName(tbDepartmentService.selectAllBelongToDepartment(list.getDepartmentUserId()));
        }

        return userOrderInfoList;
    }

}
